package com.ybwh.springboot1.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.alibaba.fastjson.JSON;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageInfo;
import com.ybwh.springboot1.dao.AreaMapper;
import com.ybwh.springboot1.model.po.Area;

@Service
public class AreaService {
	@Autowired
	private AreaMapper dao;
	
	@Transactional
	public PageInfo<Area> queryPage(){
		Page<Area> page = dao.selectByPageNumSize(new Area(), 2, 10);
		PageInfo<Area> pageInfo = new PageInfo<>(page);
		System.out.println(JSON.toJSONString(pageInfo));
		return pageInfo;
	}

}
